import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Center(
          child: Text(
            "appbar",
            textDirection: TextDirection.ltr,
            style: TextStyle(
                fontSize: 10,
                color: Colors.green,
                fontWeight: FontWeight.bold
            ),
          ),
        ),
        backgroundColor: Colors.deepPurpleAccent,
      ),
      body: Hoempae(),
      floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: (){
            print("floatbtn.jk...");
          }),
    ),
  ));
}
class Hoempae extends StatefulWidget {
  const Hoempae({Key? key}) : super(key: key);
  @override
  _HoempaeState createState() => _HoempaeState();
}

class _HoempaeState extends State<Hoempae> {
  @override
  Widget build(BuildContext context) {
    return const Image(
      //加载本地图片1。在flutter项目中创建一个文件夹，存储图片2。在pubspec.yaml进行配置
        image: AssetImage("assets/image/img.png")
    );

  }
}
